package com.briup.ch10;

/**
 * @Author briup-adam
 * @Date 2023/10/26 下午5:24
 * @Description
 **/

public class PriorityTest {
    public static void main(String[] args) {
        Thread t1 = new Thread("艳超"){
            @Override
            public void run() {
                for (int i = 1; i <1000000 ; i++) {
                    if (i%5000==0){
                        System.out.println(getName()+":"+i);
                    }

                }
            }
        };
        Thread t2 = new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 1; i < 1000000; i++) {
                    if (i % 5000 == 0) {
                        System.out.println(Thread.currentThread().getName() + ":" + i);
                    }

                }
            }
        },"驹驹");
        t1.setPriority(Thread.MIN_PRIORITY);
        t2.setPriority(10);
        t1.start();
        t2.start();
    }
}
